package com.yst.webplugin.annotation;

import java.io.Serializable;
import java.lang.annotation.*;

@ResultType(returnModelClass = true,resultTypes = {Integer.class,Long.class,Boolean.class})
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface Modify {
    Class<? extends Serializable> modelClass() default Default.class;
    /**
     * class of the valid
     * @return
     */
    Class<? extends Serializable> validClass() default Default.class;
    /**
     * group class for valid
     * @return
     */
    Class<?>[] validClassGroup() default {};

    /**
     * name of primary key field
     * @return
     */
    String keyField() default "id";

    /**
     * not need modify field
     * @return
     */
    String[] ignoreFields() default {};

    /**
     * update time need record
     * @return
     */
    String modifyTimeField() default "updateTime";

    /**
     * user id field need record
     * @return
     */
    String modifyUserIdField() default "updateUserId";

    /**
     * call back before save
     * @return
     */
    Class<? extends BeforeSave> onBeforeSave() default BeforeSave.class;

    /**
     * call back after save
     * @return
     */
    Class<? extends AfterSave> onAfterSave() default AfterSave.class;
}
